package com.zxbg.dao;

import com.zxbg.domain.SystemtoolsLeftMenu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SystemtoolsLeftMenuDao {
    @Select("select * from systemtools_menu where parent_code = #{parent_code} and tenant_id = #{tenant_id}")
    public List<SystemtoolsLeftMenu> getSystemtoolsLeftTargetMenu(@Param("parent_code") String parent_code, @Param("tenant_id") Integer tenant_id);

    @Update("update systemtools_menu set menu_name = #{menu_name} where menu_code = #{menu_code} and tenant_id = #{tenant_id}")
    public Integer updateSystemtoolsLeftMenuNameByMenuCode(@Param("menu_code") String menu_code, @Param("menu_name") String menu_name, @Param("tenant_id") Integer tenant_id);

    @Select("select menu_code from systemtools_menu where tenant_id = #{tenant_id}")
    public List<String> getAllMenuCode(Integer tenant_id);
}
